package mongo

/*var (
	DB *Database
)

type Database struct {
	Mongo *mongo.Client
}

//初始化
func Init() {
	DB = &Database{
		Mongo: SetConnect(),
	}
}

func SetConnect() (client *mongo.Client) {

	var (
		uri string
		err error
	)

	uri = conf.DriverName + "://" + conf.MasterDbConfig.Host + ":" + strconv.Itoa(conf.MasterDbConfig.Port)

	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(conf.MasterDbConfig.ConnectTimeout)*time.Microsecond)
	defer cancel()
	// 连接池
	if client, err = mongo.Connect(ctx, options.Client().ApplyURI(uri).SetMaxPoolSize(conf.MasterDbConfig.MaxPoolSize)); err != nil {
		panic(err)
	}

	return
}
*/